package last;

class Accounts{
	private  int balance;
	
	public Accounts(int balance) {
		super();
		this.balance = balance;
	}

	public int getBalance() {
		return balance;
	}
	
    public void setBalance(int balance) {
		this.balance = balance;
	}

	public  synchronized  void deposit(int money)
	{
		balance+=money;
	}
	public synchronized  void withdraw(int money) throws InterruptedException
	{
		balance-=money;
		if(balance<0) 
	        throw new IllegalStateException(balance+"");
	}
	
}
public class Main4 {

}
